Add Content

The add content function allows you to programmatically add a new content block to Ektron CMS400.NET without the need of logging in.

This function can be for several applications including, but not limited to:

Applied to a Web form, allowing you to collect data from users about the content block

Creating a loop function that moves information from a database to an Ektron CMS400.NET database

Here is the format for the add content function:

<% AddContent

Username,Password,Domain,content_title,content_comment,ContentHtml,SummaryHTML,ContentLanguage,FolderID,GoLive,EndDate,MetaInfo


%>

Warning! Every string that you pass to the function must be HTML encoded. Here is the VB.Net syntax for encoding a string.
myTitle = “John’s Book”
myTitle = Server.HtmlEncode(myTitle)

Explained in the table below are the attributes for the add content block function.

Attribute

Description

Username

The username of the user to be authenticated for permissions to see whether the user is able to add a content block.

Password

The password for the username being authenticated.

Domain

If using Active Directory, specify the domain needed to authenticate the user.

Content_title

Specify a title for the content block being added.

Content_comment

Specify a historical comment for the content being added.

ContentHTML

Actual content for the content block.

SummaryHTML

Summary information about the content block.

ContentLanguage

Language of content.

FolderID

ID number of the content folder where the content block will be added to.

GoLive

Date and time the content will go live.

Note: Must match date/time format set in the Web.config key ek_dateFormat.

EndDate

Date and time the content will expire.

Note: Must match date/time format set in the Web.config key ek_dateFormat.

MetaInfo

Specify the information for the metadata which will be used as a reference point for finding other words or information.

An example is:

<metadata><meta id="3">Title</meta></metadata>

Where ID is the metadata definition ID whose value is being set. The value is set between the meta tags and the meta tag is repeatable for as many metadata definitions as you want to set for the given content block.

Add Content Example

The following is an example of the add content function in a template:.

<tr>

  <td>

    <% AddContent "admin", "admin", "", "Content Title", "Comment",     "This is the <b>body</b> of the content.", "This is the <i>summary</i> for the content.", 1033, 31, "06-14-2004 11:55 AM",     "", "<metadata><meta id=""3"">ContentTitle</meta></metadata>","" %>

  </td>

</tr>

The previous example has the following properties:

The user “admin” is used to be authenticated.

The title of the new content block is “Content Title”.

The comment for the content is “Comment”.

The body of the content is “This is the body of the content”.

The summary of the content block is “This is the summary for the content.

The language ID = 1033, or English.

The folder ID = 31 is where the content is added.

The start date is 06-14-2004”.

No end date is specified.

The metadata definition ID being set is “3” and the value is ContentTitle.

When this function is executed, the content is added to Ektron CMS400.NET. Displayed here is the record of the content in the workarea.

Previous TopicNext Topic|